<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration {
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('projects', function (Blueprint $table) {
            $table->id();
            $table->unsignedBigInteger('category_id')->default(0)->comment('分类');
            $table->string('title')->default('')->comment('名称');
            $table->string('image')->default('')->comment('封面图');
            $table->text('describe')->nullable()->comment('描述');
            $table->date('date')->nullable()->comment('时间');
            $table->unsignedInteger('province_id')->default(0)->comment('省');
            $table->unsignedInteger('city_id')->default(0)->comment('市');
            $table->unsignedInteger('district_id')->default(0)->comment('区');
            $table->decimal('price', 20)->default(0.00)->comment('价格');
            $table->text('content')->nullable()->comment('详情');
            $table->unsignedBigInteger('number')->default(0)->comment('销量');
            $table->boolean('show')->default(true)->comment('显示');
            $table->unsignedInteger('sort')->default(1)->comment('排序值');
            $table->softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('projects');
    }
};
